﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using GameEngine.View.Components;

namespace MySettlers.View.Components.editor
{
    public partial class EditorEditGameUC : UserControl, IMenuView<string>
    {
        public event OnButtonClickHandler<string> OnExternalActionButtonClick;

        public const string SAVEBUTTON = "SAVEBUTTON";
        public const string EXITBUTTON = "EXITBUTTON";

        public EditorEditGameUC()
        {
            InitializeComponent();
            SaveButton.Tag = SAVEBUTTON;
            ExitButton.Tag = EXITBUTTON;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;
            OnExternalActionButtonClick(b.Tag as string);
        }

        public void SetWorldContainer(UserControl uc) {
            worldContainer.Children.Clear();
            worldContainer.Children.Add(uc);
        }

        public void SetMapEditorMenuContainer(UserControl uc)
        {
            mapEditorMenuContainer.Children.Clear();
            mapEditorMenuContainer.Children.Add(uc);
        }

        public void SetThingEditorMenuContainer(UserControl uc)
        {
            thingEditorMenuContainer.Children.Clear();
            thingEditorMenuContainer.Children.Add(uc);
        }

        public void SetWorldEditorMenuContainer(UserControl uc)
        {
            worldEditorContainer.Children.Clear();
            worldEditorContainer.Children.Add(uc);
        }
    }
}
